// 登录相关接口
import { LoginAPIRes } from '@/types/login'
import { ResUseInfo } from '@/types/profile'
import http from '@/utils/http'

enum API {
  // 登录
  LOGIN_URL = '/authorizations',
  // 获取用户信息
  USERINFO_URL = '/user/profile'
}

/**
 * 登录账号
 * @param data 登录参数
 * @returns
 */
export const reqLogin = (data: { mobile: number; code: string }) => {
  return http.post<any, LoginAPIRes>(API.LOGIN_URL, data)
}

export const reqGetUserInfo = () => {
  return http.get<any, ResUseInfo>(API.USERINFO_URL)
}
